package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

@Entity
public class Zshipments {
    private int shipmentsId;//发货单id
    private TfyclientForm clientId;//客户
    private Zchuku chukuId;//出库单
    private String shipmentsShipper;//发货人
    private String shipmentsConsignee;//收货人
    private Timestamp shipmentsTime;//发货日期
    private String shipmentsPhone;//电话
    private String shipmentsProvince;//省份
    private String shipmentsCity;//城市
    private String shipmentsDiqu;//区县
    private String shipmentsSite;//详细地址
    private String shipmentsPostcode;//邮编
    private String shipmentsMode;//发货方式
    private String shipmentsFirm;//发货物流公司
    private String shipmentsNumbers;//发货物流单号
    private String shipmentsState;//发货状态
    private String shipmentsMoneyjsf;//运费结算方
    private BigDecimal shipmentsMoney;//发货运费
    private String shipmentsRemark;//发货备注7
    private List<Zshipmentsdetails> xq;
    private String shipmentsDizhisz;

    @Id
    @Column(name = "shipments_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public int getShipmentsId() {
        return shipmentsId;
    }

    public void setShipmentsId(int shipmentsId) {
        this.shipmentsId = shipmentsId;
    }

    @ManyToOne
    @JoinColumn(name = "client_id", referencedColumnName = "client_id")
    public TfyclientForm getClientId() {
        return clientId;
    }

    public void setClientId(TfyclientForm clientId) {
        this.clientId = clientId;
    }

    @ManyToOne
    @JoinColumn(name = "chuku_id", referencedColumnName = "chuku_id")
    public Zchuku getChukuId() {
        return chukuId;
    }

    public void setChukuId(Zchuku chukuId) {
        this.chukuId = chukuId;
    }

    @OneToMany(mappedBy = "shipmentsId")
    public List<Zshipmentsdetails> getXq() {
        return xq;
    }

    public void setXq(List<Zshipmentsdetails> xq) {
        this.xq = xq;
    }

    @Basic
    @Column(name = "shipments_dizhisz")
    public String getShipmentsDizhisz() {
        return shipmentsDizhisz;
    }

    public void setShipmentsDizhisz(String shipmentsDizhisz) {
        this.shipmentsDizhisz = shipmentsDizhisz;
    }

    @Basic
    @Column(name = "shipments_diqu")
    public String getShipmentsDiqu() {
        return shipmentsDiqu;
    }

    public void setShipmentsDiqu(String shipmentsDiqu) {
        this.shipmentsDiqu = shipmentsDiqu;
    }

    @Basic
    @Column(name = "shipments_moneyjsf")
    public String getShipmentsMoneyjsf() {
        return shipmentsMoneyjsf;
    }

    public void setShipmentsMoneyjsf(String shipmentsMoneyjsf) {
        this.shipmentsMoneyjsf = shipmentsMoneyjsf;
    }

    @Basic
    @Column(name = "shipments_shipper")
    public String getShipmentsShipper() {
        return shipmentsShipper;
    }

    public void setShipmentsShipper(String shipmentsShipper) {
        this.shipmentsShipper = shipmentsShipper;
    }

    @Basic
    @Column(name = "shipments_time")
    public Timestamp getShipmentsTime() {
        return shipmentsTime;
    }

    public void setShipmentsTime(Timestamp shipmentsTime) {
        this.shipmentsTime = shipmentsTime;
    }

    @Basic
    @Column(name = "shipments_consignee")
    public String getShipmentsConsignee() {
        return shipmentsConsignee;
    }

    public void setShipmentsConsignee(String shipmentsConsignee) {
        this.shipmentsConsignee = shipmentsConsignee;
    }

    @Basic
    @Column(name = "shipments_phone")
    public String getShipmentsPhone() {
        return shipmentsPhone;
    }

    public void setShipmentsPhone(String shipmentsPhone) {
        this.shipmentsPhone = shipmentsPhone;
    }

    @Basic
    @Column(name = "shipments_province")
    public String getShipmentsProvince() {
        return shipmentsProvince;
    }

    public void setShipmentsProvince(String shipmentsProvince) {
        this.shipmentsProvince = shipmentsProvince;
    }

    @Basic
    @Column(name = "shipments_city")
    public String getShipmentsCity() {
        return shipmentsCity;
    }

    public void setShipmentsCity(String shipmentsCity) {
        this.shipmentsCity = shipmentsCity;
    }

    @Basic
    @Column(name = "shipments_site")
    public String getShipmentsSite() {
        return shipmentsSite;
    }

    public void setShipmentsSite(String shipmentsSite) {
        this.shipmentsSite = shipmentsSite;
    }

    @Basic
    @Column(name = "shipments_postcode")
    public String getShipmentsPostcode() {
        return shipmentsPostcode;
    }

    public void setShipmentsPostcode(String shipmentsPostcode) {
        this.shipmentsPostcode = shipmentsPostcode;
    }

    @Basic
    @Column(name = "shipments_mode")
    public String getShipmentsMode() {
        return shipmentsMode;
    }

    public void setShipmentsMode(String shipmentsMode) {
        this.shipmentsMode = shipmentsMode;
    }

    @Basic
    @Column(name = "shipments_state")
    public String getShipmentsState() {
        return shipmentsState;
    }

    public void setShipmentsState(String shipmentsState) {
        this.shipmentsState = shipmentsState;
    }


    @Basic
    @Column(name = "shipments_firm")
    public String getShipmentsFirm() {
        return shipmentsFirm;
    }

    public void setShipmentsFirm(String shipmentsFirm) {
        this.shipmentsFirm = shipmentsFirm;
    }

    @Basic
    @Column(name = "shipments_numbers")
    public String getShipmentsNumbers() {
        return shipmentsNumbers;
    }

    public void setShipmentsNumbers(String shipmentsNumbers) {
        this.shipmentsNumbers = shipmentsNumbers;
    }

    @Basic
    @Column(name = "shipments_money")
    public BigDecimal getShipmentsMoney() {
        return shipmentsMoney;
    }

    public void setShipmentsMoney(BigDecimal shipmentsMoney) {
        this.shipmentsMoney = shipmentsMoney;
    }

    @Basic
    @Column(name = "shipments_remark")
    public String getShipmentsRemark() {
        return shipmentsRemark;
    }

    public void setShipmentsRemark(String shipmentsRemark) {
        this.shipmentsRemark = shipmentsRemark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Zshipments that = (Zshipments) o;
        return shipmentsId == that.shipmentsId &&
                Objects.equals(clientId, that.clientId) &&
                Objects.equals(shipmentsShipper, that.shipmentsShipper) &&
                Objects.equals(shipmentsTime, that.shipmentsTime) &&
                Objects.equals(shipmentsConsignee, that.shipmentsConsignee) &&
                Objects.equals(shipmentsPhone, that.shipmentsPhone) &&
                Objects.equals(shipmentsProvince, that.shipmentsProvince) &&
                Objects.equals(shipmentsCity, that.shipmentsCity) &&
                Objects.equals(shipmentsSite, that.shipmentsSite) &&
                Objects.equals(shipmentsPostcode, that.shipmentsPostcode) &&
                Objects.equals(shipmentsMode, that.shipmentsMode) &&
                Objects.equals(shipmentsState, that.shipmentsState) &&
                Objects.equals(shipmentsFirm, that.shipmentsFirm) &&
                Objects.equals(shipmentsNumbers, that.shipmentsNumbers) &&
                Objects.equals(shipmentsMoney, that.shipmentsMoney) &&
                Objects.equals(shipmentsRemark, that.shipmentsRemark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(shipmentsId, clientId, shipmentsShipper, shipmentsTime, shipmentsConsignee, shipmentsPhone, shipmentsProvince, shipmentsCity, shipmentsSite, shipmentsPostcode, shipmentsMode, shipmentsState, shipmentsFirm, shipmentsNumbers, shipmentsMoney, shipmentsRemark);
    }
}
